package org.ipms.c.common.persistence.web;

public class ResponseResult {

	/** 
     * 请求成功返回 
     * @param object 
     * @return 
     */  
    public static ResponseData success(Object object){  
        ResponseData rData = new ResponseData();  
        rData.setCode(ResponseCode.SUCCESS.code);  
        rData.setMsg(ResponseCode.getMessageInfo(ResponseCode.SUCCESS.code));  
        rData.setData(object);  
        return rData;  
    }  
    
    /**
     * 请求成功，不需要data
     * @return
     * */
    public static ResponseData success(){  
        return success(null);  
    }  
  
    /**
     * 请求失败返回
     * @param code
     * @return
     * */
    public static ResponseData error(Integer code){  
    	ResponseData rData = new ResponseData();  
    	rData.setCode(code);  
    	rData.setMsg(ResponseCode.getMessageInfo(code));  
        return rData;  
    } 
}
